package com.tul.exercise.base.clazz.base.eg6;

import com.tul.exercise.base.clazz.base.eg6.base.Pet;
import org.junit.jupiter.api.Test;

import java.util.List;

/**
 * @ClassName Pets
 * @Description LiteralPetCreator的外观类,对LiteralPetCreator的创建Pet方法进行包装
 * @Author tul 2018/10/13
 * @Version 1.0
 **/
public class Pets {
    /**
     * 聚合一个LiteralPetCreator类
     */
    public static final PetCreator creator = new LiteralPetCreator();

    public static Pet randomPet() {
        return creator.randomPet();
    }

    public static Pet[] createArray(int size) {
        return creator.createArray(size);
    }

    public static List<Pet> arrayList(int size) {
        return creator.arraylist(size);
    }

    public static void main(String[] args) {
        PetCount.countPets(Pets.creator);
    }
    @Test
    public void test() {
        PetCount.countPets(Pets.creator);
    }
}
